package com.example;

import com.example.service.orderservice;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class mainapp {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(app.class);
        orderservice orderService = context.getBean(orderservice.class);

        System.out.println("=== 测试 add 方法 ===");
        orderService.add("iPhone", 2);

        System.out.println("\n=== 测试 delete 方法 ===");
        orderService.delete("MacBook");

        System.out.println("\n=== 测试 find 方法 ===");
        int count = orderService.find("iPad");
        System.out.println("最终查询结果: " + count);

        context.close();
    }
}